import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Demo22 {
    public static void main(String[] args) throws InterruptedException {
        ExecutorService pool = Executors.newFixedThreadPool(4);
        for (int i = 0; i <100 ; i++) {
            int id = i;
            pool.submit(()->{
                Thread current = Thread.currentThread();
                System.out.println("hello"+ id +","+current.getName());
            });
        }
        Thread.sleep(2000);
        pool.shutdown();
    }
}
